package com.example.springlist.business.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.springlist.business.entity.Todos;
import com.example.springlist.business.mapper.TodosMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TodosServer extends ServiceImpl<TodosMapper, Todos> {

    public int deleteById(int id){
        return baseMapper.deleteById(id);
    }

    public int deleteAll(){
        return baseMapper.deleteAll();
    }
    public int selectById(int done, int id){
        return baseMapper.selectById(done, id);
    }
    public int selectAll(int done){
        return baseMapper.selectAll(done);
    }
    public int add(Todos todos){
        String title = todos.getTitle();
        return baseMapper.add(title, 0);
    }
}
